package org.bigjava.controller;

import org.bigjava.bean.Admin;
import org.bigjava.biz.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Controller
//@RestController
public class HelloController {

    @Autowired
    AdminService adminService;

    @RequestMapping("/myindex")
    public String oneHello(){
        System.out.println("oneHello()");
        return "哈哈哈哈哈";
    }

    @RequestMapping("user/show")
    public Admin getUser(){
        Admin user = new Admin();
        user.setId(1);
        user.setUsername("掌声");
        user.setNickname("展示");
        user.setPassword("111");
        return user;
    }

    @RequestMapping("/admin")
    public String cha(){
        System.out.println("cha中");
//        List<Admin> list = adminService.cha();
//        System.out.println(list+"HHH");
        return "ljfl";
    }

    @RequestMapping("/login")
    public String loginPage(){
        return "ljfl";
    }
}
